import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Layout } from 'antd';
import { HashRouter as Router, Switch, Route } from 'react-router-dom';
import HeaderCpt from '../../components/header';
import FooterCpt from '../../components/footer';
import ArticleList from '../../components/articleList';
import ArticleDetail from '../../components/articleDetail';
import Maze from '../../components/maze';

import './style.less';

const { Content } = Layout;

class Index extends Component {
	render() {
		return (
			<Layout style={{ minHeight: '100vh' }}>
				<HeaderCpt></HeaderCpt>
				<Content className="main">
					<Router>
						<Switch>
							<Route exact path="/index/maze" component={Maze} />
							<Route exact path="/index" component={ArticleList} />
							<Route path="/index/:id" component={ArticleDetail} />
						</Switch>
					</Router>
				</Content>
				<FooterCpt></FooterCpt>
			</Layout>
		);
	}
}

export default connect(null, null)(Index);
